package com.coffee.controller;

import com.coffee.conmmon.BaseResult;
import com.coffee.service.ScardsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("Scards")
@Api(description = "星礼卡相关接口")
@CrossOrigin
public class ScardsController {
    @Autowired
    private ScardsService scardsService;
    @RequestMapping(value = "findAll",method = RequestMethod.POST)
    @ApiOperation("星礼卡查询全部")
    public BaseResult findAll(){
        return scardsService.findAll();
    }
    @RequestMapping(value = "findByCid",method = RequestMethod.POST)
    @ApiOperation("星礼卡详情")
    public BaseResult findByCid(@RequestBody Map map){
        Integer cid = (Integer) map.get("cid");
        return scardsService.findByCid(cid);
    }
}
